import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { media_infoVO, media_infoForm, media_infoQuery } from '@/api/camera/media_info/types';

/**
 * 查询媒体库列表
 * @param query
 * @returns {*}
 */

export const listmedia_info = (query?: media_infoQuery): AxiosPromise<media_infoVO[]> => {
  return request({
    url: '/camera/media_info/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询媒体库详细
 * @param mediaInfoId
 */
export const getmedia_info = (mediaInfoId: string | number): AxiosPromise<media_infoVO> => {
  return request({
    url: '/camera/media_info/' + mediaInfoId,
    method: 'get'
  });
};

/**
 * 新增媒体库
 * @param data
 */
export const addmedia_info = (data: media_infoForm) => {
  return request({
    url: '/camera/media_info',
    method: 'post',
    data: data
  });
};

/**
 * 修改媒体库
 * @param data
 */
export const updatemedia_info = (data: media_infoForm) => {
  return request({
    url: '/camera/media_info',
    method: 'put',
    data: data
  });
};

/**
 * 删除媒体库
 * @param mediaInfoId
 */
export const delmedia_info = (mediaInfoId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/media_info/' + mediaInfoId,
    method: 'delete'
  });
};
